Title: SQL W3S (By-BKK) / 029 Full Join
Tags: Obsidian_to_Anki

Q: What does the SQL FULL OUTER JOIN keyword do?
A: It returns all records when there is a match in the left or right table

Q: True or False: FULL OUTER JOIN and FULL JOIN mean the same thing in SQL
A: True

Q: What is the syntax for a SQL FULL OUTER JOIN?
A: SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name = table2.column_name WHERE condition

Q: True or False: FULL OUTER JOIN can return very large result sets
A: True

Q: FULL OUTER JOIN can return records when rows in one table do not match any row in the other table.
A: True

Q: True or False: FULL OUTER JOIN only returns records where there is a match in both tables
A: False

Q: Which SQL JOIN shows all customers, even those with no orders, and all orders, even those with no customer?
A: FULL OUTER JOIN

Q: FULL OUTER JOIN result sets include what when there is no match in one table?
A: Rows from the unmatched table with NULL values for columns from the other table

Q: Give an example of a SQL FULL OUTER JOIN statement
A: SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID ORDER BY Customers.CustomerName

Q: Customers.CustomerName is NULL and Orders.OrderID is not NULL in a FULL OUTER JOIN result set—what does this mean?
A: There is an order without a corresponding customer

Q: In a FULL OUTER JOIN, what happens when there is no match in Orders for a Customer?
A: The Customer row appears with NULL values for Orders columns

Q: OrderID is NULL and CustomerName is not NULL in a FULL OUTER JOIN result set—what does this signify?
A: A customer has no order

Q: What sample database is used in the FULL OUTER JOIN example?
A: Northwind

Q: FULL OUTER JOIN returns all rows from both tables, even if there is no match
A: True

Q: When should you use FULL OUTER JOIN?
A: When you need all records from both tables, regardless of a match